Queue
Operates on a First In, First Out (FIFO) principle
Stack
Operates on a Last In, Last Out (LIFO) principle
Bubble Sort
Bubble Sort Visualizer
Selection Sort
Selection Sort Visualizer
Merge Sort
Merge Sort Visualizer
Sliding Window Sort
Sliding Window Visualizer
Binary Search
Binary Search Visualizer
Linked List
Linked List Visualizer
Quick Sort
Quick Sort Visualizer
Two Pointer Sort
Two Pointer Visualizer
Sieve of Eratosthenes
Sieve of Eratosthenes Visualizer
Bubble Sort Visualization
OVERVIEW
Bubble Sort is the simplest sorting algorithm that works by repeatedly swapping the adjacent elements if they are in the wrong order. This algorithm is not suitable for large data sets as its average and worst-case time complexity are quite high.
Time Complexity
Best Case: O(n)(if already sorted, only one pass needed).
Worst Case: O(n2)(if the array is sorted in reverse order).
Space Complexity: O(1)(in-place sorting, no extra space required).
Color Representation
Orange → The two elements being compared.
Red → Elements still unsorted.
Green → Elements that are sorted and in their final position.